<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>用户管理</title>
</head>
<body>
<div ng-app="myApp" ng-controller="ConfigCtrl">
    <div class="col-md-6">
        <ui-form key="userAdd" column="2" class="row">
            <div class="row">
                <input name="id" type="hidden" value="{{nodeData.id}}"/>
            </div>
            <ui-form-input name="configName" label="参数名:"></ui-form-input>
            <ui-form-input name="configValue" label="参数值:"></ui-form-input>
        </ui-form>
    </div>
</div>


<script>
    angular.module('myApp', ['ui.form','ui.tree']);
    angular.module('myApp').controller('ConfigCtrl', function ($scope) {
        var url = "system/sysconfig/add";
        $scope.nodeData = {};
        $scope.$on('ui.form.submit',function (event,param) {
            $.ajax({
                url:url,
                type:"post",
                data:param
            }).done(function (result) {
                if(result.code == '0000'){
                    toastr.success("新增成功");
                    if(opener && opener.reloadTable){
                        opener.reloadTable({});
                    }
                    setTimeout(function () {
                        window.location.href="system/sysconfig/index.htm";
                    },1500);
                }else{
                    toastr.error(result.msg);
                }
            }).fail(function (err) {

            });
        })
    });
</script>
</body>
</html>
